//
//  GoodsSpecificationCell.m
//  BonweBuy
//
//  Created by liuxin on 2020/2/25.
//  Copyright © 2020 liuxin. All rights reserved.
//

#import "GoodsSpecificationCell.h"

@interface GoodsSpecificationCell()
@property (nonatomic, strong) UILabel *titleLabel;
@end

@implementation GoodsSpecificationCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        UILabel *titleLabel = [UILabel new];
        titleLabel.font = UIPFRegularFont(13);
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.layer.borderWidth = 1;
        titleLabel.textColor = [UIColor grayColor];
        titleLabel.layer.borderColor = [UIColor grayColor].CGColor;
        [self.contentView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];
        self.titleLabel = titleLabel;
    }
    return self;
}

-(void)setSkuModel:(SaleAttr2ListModel *)skuModel{
    _skuModel = skuModel;
    self.titleLabel.text  =_skuModel.saleAttr2Value;
    if (_skuModel.isStock) {
        self.titleLabel.textColor = [UIColor grayColor];
        self.titleLabel.layer.borderColor = [UIColor grayColor].CGColor;
    }else{
        self.titleLabel.textColor = kAppGaryColor;
        self.titleLabel.layer.borderColor = kAppGaryColor.CGColor;
    }
}

@end
